﻿<%@ Page Language="C#"  %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data.SqlClient" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" lang="heb"  dir="rtl">
<head id="Head1" runat="server">
       

   
   
    <!-- Plugin stylesheets -->
  
    <link href="http://global-assetsgroup.com/hw/fl/uniform.default.css" type="text/css" rel="stylesheet" />        
    <link href="http://global-assetsgroup.com/hw/fl/jquery.dataTables.css" type="text/css" rel="stylesheet" />
    
    <!-- Main stylesheets -->
   
<style>

    .btn_edit
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/edit-notes.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
     .btn_view
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/eye_quick_view.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
   .frm_row
   {
       width:95%;
       float:left;
       
   }
   .frm_row label
   {
       float:left;
       width:40%;
       margin-right:20px;
   }
   .frm_row input[type="text"],select
   {
       float:left;
       width:50%;
   }
</style>

        <title></title>
</head>
<body>
  
   
    <%  
      
        SqlConnection con = null;
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con.Open();

        SqlCommand hmd = new SqlCommand("SELECT * FROM properties where status1='" + "1" + "'", con);
       
        SqlDataReader hr = hmd.ExecuteReader();

        Response.Write("<div class=\"content noPad clearfix\">");
        Response.Write(" <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"responsive dynamicTable display table table-bordered\" id=\"mytable\"  >");
        Response.Write(" <thead>  <tr><th >מזהה נכס</th> <th>סוכן</th><th >סוג לקוח</th><th>שם מלא</th> <th>טלפון</th><th>סוג נכס</th><th>עיר</th>  <th>שכונה</th><th>ארץ</th> <th>מס' חדרים</th><th>גודל הנכס</th> <th>מרפסת</th><th>מעלית</th><th>חניה</th> <th>תקציב</th> <th>הערות</th>  <th>הצג</th> <th>ערוך</th><th>מחק</th><th>שלח לארכיון</th></tr></thead>");                       
        Response.Write("<tbody>");
    
      while (hr.Read())
      {
          string comment;
          comment = hr[79].ToString();
          if (string.IsNullOrEmpty(comment) == true)
          {

          }
          else
          {
              comment = comment.Substring(0,1);
          }

          
          string a;
          a = hr[2].ToString();

          if (hr[2].ToString() == "שדה למילוי עצמי")
          {
              a = "";
          }

          else
          {
              a = hr[2].ToString();
          }




          string b;
          b = hr[42].ToString();

          if (hr[42].ToString() == "שדה למילוי עצמי")
          {
              b = "";
          }

          else
          {
              b = hr[42].ToString();
          }



          string c;
         c = hr[5].ToString();

          if (hr[5].ToString() == "שדה למילוי עצמי")
          {
              c = "";
          }

          else
          {
              c = hr[5].ToString();
          }




          string d;
          d = hr[51].ToString();

          if (hr[51].ToString() == "שדה למילוי עצמי")
          {
              d = "";
          }

          else
          {
              d = hr[51].ToString();
          }



          string e;
          e = hr[63].ToString();

          if (hr[63].ToString() == "שדה למילוי עצמי")
          {
              e = "";
          }

          else
          {
              e = hr[63].ToString();
          }



          string f;
          f = hr[25].ToString();

          if (hr[25].ToString() == "שדה למילוי עצמי")
          {
              f = "";
          }

          else
          {
              f= hr[25].ToString();
          }

          
          
          //  Response.Write("<td class=\"center tr_select \"><input name=\"checkbox\" type=\"checkbox\" value=\"\"></td><td>" + hr[1].ToString() + "</td><td>" + hr[2].ToString() + "</td><td>" + hr[3].ToString() + "</td><td>" + hr[4].ToString() + "</td><td><a href=\"#\" class=\"btn_attch\" title=\"View Attachment\"></a></td><td><a href=\"#\" class=\"btn_view\" title=\"View\"></a><a href=\"#\" class=\"btn_reply\" title=\"Reply\"></a><a href=\"#\" class=\"btn_del\" title=\"Delete\"></a></td></tr>");

          Response.Write("<tr> <td>" + hr[0].ToString() + "</td> <td>" + hr[4].ToString() + "</td><td>" + a + "  " + hr[3].ToString() + " </td><td>" + hr[6].ToString() + "  " + hr[7].ToString() + " </td><td>" + hr[9].ToString() + "  </td><td>" + c + "  " + hr[83].ToString() + " </td> <td>" + hr[16].ToString() + "</td> <td>" + hr[18].ToString() + "</td> <td>  " + hr[21].ToString() + "</td> <td>" + hr[22].ToString() + "</td> <td>" + b + "  " + hr[43].ToString() + "</td><td>" + f + "  " + hr[26].ToString() + "</td> <td>" + d + "  " + hr[52].ToString() + " </td><td> " + a + "  " + hr[64].ToString() + "</td> <td>" + hr[40].ToString() + " " + hr[41].ToString() + " </td><td>" + comment + "</td><td><a href=\"#\" class=\"btn_view\" title=\"View\"></a></td><td><a href=\"#\" class=\"btn_edit\" title=\"Edit\"></td><td></a><a href=\"#\" class=\"btn_del\" title=\"Reply\"></a></td><td><a href=\"#\" class=\"btn_reply\" title=\"Delete\"></a></td></td></tr>");

          //    Response.Write(regid);
      }
     
      Response.Write("</tbody>");
      Response.Write(" </table>");
      Response.Write(" </div>");
     hr.Close();
      con.Close(); %>
      

 <!--your content end-->
    
    </div> <!--toPopup end-->
  


 

</body>
</html>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>

<script type="text/javascript" src="http://global-assetsgroup.com/hw/fl/popup.js"></script>
   
		<script type="text/javascript" language="javascript" src="http://global-assetsgroup.com/hw/fl/jquery.dataTables.js"></script>
				  <script type="text/javascript" charset="utf-8">
		      $(document).ready(function () {
		          oTable = $('#dtable').dataTable({
		              "bJQueryUI": true,
		              "sPaginationType": "full_numbers"
		          });
		      });


		</script>
    
      
  <style>
   .btn_reply
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/reply.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
     .btn_attch
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/1393645982_103307.ico");
        background-repeat:no-repeat;
        background-position:center center;
    }
      .btn_del
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/Remove.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
    .btn_edit
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/edit-notes.png");
        background-repeat:no-repeat;
        background-position:center center;
    }
      .btn_view
    {
        text-decoration:none;
        padding:2px 10px;
        color:#202020;
        border:1px solid #ccc;
        background-image:url("img/eye_quick_view.png");
        background-repeat:no-repeat;
        background-position:center center;
    }

    </style>
     <link href="plugins/forms/uniform/uniform.default.css" type="text/css" rel="stylesheet" />        
    <link href="plugins/tables/dataTables/jquery.dataTables.css" type="text/css" rel="stylesheet" />
    
  <script type="text/javascript" charset="utf-8">
      $(document).ready(function () {
          $('#Button1').click(function () {
              var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();

              // Save it!
              //    document.location = 'to-rentupdate.aspx?id=' + $name;



          });
      });
</script>




<script type="text/javascript">
    var data;
    $('#Button1').click(function () {

        
        document.location = 'preview1.aspx';


    });


  
    

</script>










     <script type="text/javascript" charset="utf-8">
         $(document).ready(function () {
             $('.btn_edit').click(function () {
                 var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();


                 // Save it!
                 document.location = 'edit-newcl-rent.aspx?id=' + $name;



             });
         });
</script>
 <script type="text/javascript" charset="utf-8">

     $(document).ready(function () {
         $('.btn_del').click(function () {
             var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();

             if (confirm('Are you sure you want to Delete this Property?')) {
                 // Save it!
                 document.location = 'del-rent.aspx?id=' + $name;


             } else {
                 // Do nothing!
             }
            
             // Save it!
            


         });
     });
</script>
 <script type="text/javascript" charset="utf-8">
     $(document).ready(function () {
         $('.btn_view').click(function () {
             var $td = $(this).closest('tr').children('td'),
            $name = $td.eq(0).text();


             // Save it!
             document.location = 'view_want_to_rent.aspx?id=' + $name;



         });
     });
</script>

   <script type="text/javascript" src="http://global-assetsgroup.com/hw/fl/jquery.uniform.min.js"></script>
        
    <!-- Fix plugins -->
  
    <script type="text/javascript" src="http://global-assetsgroup.com/hw/fl/datatable.js"></script><!-- Init plugins only for page -->
<script>
     $('#dtable').dataTable({
         "bServerSide": true,
         "fnServerData": getRows,
         "bDestroy": true
     });

     </script>